# It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Desktop Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description - Script to set time format # Parameters - "" # Configuration Type - USER/COMPUTERs # Example: EEE d MMM h:mm:ss a # EEE - day of the week (not mandatory) # d MMM represent the date and month (not mandatory , non - atomic) # h represnt 12 hour format , for 24 hour format use HH (Mandatory) # mm is minutes (Mandatory) # ss is seconds (Mandatory) # a is to indicate if AM/PM can be there (not mandatory) # the arguments should be present in the order mentioned in the example if [ $# == '1' ]; then defaults write com.apple.menuextra.clock "DateFormat" '$1' killall -KILL SystemUIServer # the killall kill is there to ensure that the changes take effect ret=$? if [ $ret == "0" ]; then echo "Format changed Successfully" else echo "Error in format change" fi exit $ret else echo "Invalid Arguments - Please refer description of the script" exit 1 fi